Skip to content

Check plugin.yml with the parser a server uses - #41

Merged
dmccoystephenson merged 2 commits into
mainfrom
feature/manifest-test-real-parser
Nov 6, 2026
Merged

dmccoystephenson merged 2 commits into
mainfrom
feature/manifest-test-real-parser

Conversation

@dmccoystephenson

Copy link
Copy Markdown
Member

Summary

PluginManifestTest exists to notice a manifest problem before a server does, but it read plugin.yml as plain YAML and never reached the parser a server uses.

  • The manifest is now loaded through Bukkit's PluginDescriptionFile, so anything that parser rejects fails the suite.
  • The name and api-version are now asserted. Both are stated in the docs, and the name is the prefix of /flycommand:fly.
  • The README's Testing section describes the new check.

Tests and docs only. Main.java, plugin.yml and the workflows are untouched.

Closes #39

Limitation

The permission default is still read as plain YAML. PluginDescriptionFile.getPermissions() builds Permission objects, which need a running server (NullPointerException on Bukkit.getServer()). The parser does load the whole file, but the permissions block's content is not checked by it here.

Skipped

Validation

mvn -B clean package: Tests run: 10, Failures: 0, Errors: 0, Skipped: 0, BUILD SUCCESS, on the restored plugin.yml (git status shows it unchanged).

Each mutation below was applied to plugin.yml temporarily and reverted:

plugin.yml mutation Old test New test
name: Fly Command Passed (3 of 3, with api-version: 1.12 also applied) nameIsTheOneTheDocsUse failed: expected: <FlyCommand> but was: <Fly_Command>
api-version: 1.12 Passed (same run) apiVersionIsTheOneTheDocsState failed: expected: <1.13> but was: <1.12>
name: Fly!Command Not run InvalidDescriptionException: name 'Fly!Command' contains invalid characters.

The DPC testing conventions page was not read: gh api needs approval in this headless run. No on-server recipe applies, because no plugin behaviour changes.

This PR description was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).

🤖 Generated with Claude Code


drafted by Claude on behalf of Daniel Stephenson

dmccoystephenson and others added 2 commits November 6, 2026 01:37
PluginManifestTest read the manifest as plain YAML, so a name the server
would rewrite or reject and a wrong api-version all passed. Load it
through PluginDescriptionFile and assert the name and api-version. The
permission default stays on plain YAML because building a Permission
needs a running server.

Closes #39

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dmccoystephenson

Copy link
Copy Markdown
Member Author

Self-review rubric, scored on 454e685. This is the review for this PR: it is a self-review, not an independent one, and Copilot could not be added as a reviewer (Could not resolve user with login 'copilot').

  • Scope: PASS. git diff --name-only origin/main HEAD lists only README.md and PluginManifestTest.java, both named by PluginManifestTest never reaches the parser a server uses, or checks the name and api-version #39.
  • Validation-new: PASS. The name and api-version assertions each failed on their own mutation of plugin.yml; output is in the PR body.
  • Validation-fix: PASS. The old test passed with name: Fly Command and api-version: 1.12 applied; the new test fails on each, and on name: Fly!Command. mvn -B -o test then printed Tests run: 10, Failures: 0, Errors: 0, Skipped: 0 on the restored manifest.
  • Sibling structure: PASS. The test class keeps its four-space style and JUnit 5 usage; no file was added.
  • Sibling renames: PASS. declaresTheFlyCommandAndItsPermission was split in two, and nothing else references it.
  • Docs: FAIL, then fixed. The first README wording implied PluginDescriptionFile also checks the permission, which it does not. Corrected in 454e685. USER_GUIDE.md, COMMANDS.md, CONFIG.md and CONTRIBUTING.md make no claim about how the manifest is tested. .github/copilot-instructions.md is still accurate.
  • Issue resolution: PASS. PluginManifestTest never reaches the parser a server uses, or checks the name and api-version #39 names the parser, the name and api-version assertions, and the README; all are changed.
  • Manifest declaration: PASS. git status confirmed plugin.yml was restored and it is not in the diff.
  • Command declaration: PASS. declaresTheFlyCommand still asserts Fly, which Main.java:22 handles.
  • Main-class resolution: PASS. mainNamesThePluginClass passes through the new parser.
  • Override annotations: PASS. Main.java is not in the diff.
  • No stack change: PASS. pom.xml is not in the diff; PluginDescriptionFile ships in the existing spigot-api dependency.
  • Changelog: PASS (not applicable). The change is test and contributor documentation only, so no player or operator sees it.
  • No harness leakage: PASS. No .claude/ path is in the diff, and scratch files were kept in the ignored target/.
  • Manual validation: PASS. The Build run on the PR passed, including its Bukkit API step. That step never touches test code, so it adds no signal for this PR beyond confirming the plugin is unchanged.

Findings left open, none blocking:

  • src/test/java/me/Daniel/FlyCommand/PluginManifestTest.java:15 — "the plugin.yml that ends up in the jar", like the README's "packed into the jar", is loose: the test reads the copy in target/classes, which is what the jar is packed from. This wording predates this PR.
  • README.md:51 — the permission block's content is still not validated by the server parser, as stated in the PR body's Limitation section.

The checks do not start a server, so plugin loading is still verified by hand. No DPC testing convention was checked, because gh api needs approval in this run.

This review was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).


drafted by Claude on behalf of Daniel Stephenson

@dmccoystephenson
dmccoystephenson merged commit 353d7f9 into main Nov 6, 2026
1 check passed
@dmccoystephenson
dmccoystephenson deleted the feature/manifest-test-real-parser branch November 6, 2026 08:38
dmccoystephenson added a commit that referenced this pull request Nov 12, 2026
Five merges since the 1.0.0 release changed what users or contributors
see without a CHANGELOG entry: the README image (#29), the CONTRIBUTING
build step (#28), the dev prerelease wording (#33), the CONFIG.md
permission text (#34) and the PluginDescriptionFile manifest tests (#41).
The Unreleased section even logged a fix to the image's caption without
ever logging the image. Add the missing entries.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PluginManifestTest never reaches the parser a server uses, or checks the name and api-version

1 participant